/****************************************************************************
*
* Description: Source base interface
* Module: 'source.h'
* Created at: 24.06.06 17:02:38 UTC
*
* $Revision$
*
****************************************************************************/
#pragma once

#if !defined(__STORAGE_SOURCE_H__)
#define __STORAGE_SOURCE_H__

#include <list>
#include <common/exception.h>

namespace storage {

DEFINE_NEW_ERROR(invalid_source);

/* Defines list of addresses.  */
/* TODO: possible, it should be defined in memory module.  */
typedef std::list< common::memory::addr_t >	addrs_t;

/* Ok, abstract source interface.  */
struct source
{
	/* Read data from data source to storage.  */
    virtual void read() = 0;

	/* Defines that source is valid for data in underlying storage.  */
    virtual bool is_valid() = 0;

	/* Map data to memory.  */
    virtual void map_to(common::memory::memory_manager_t &) = 0;

	/* Return data entry points, if they are exists.  */
	virtual void get_entry_points(addrs_t & eps) = 0;
};

} /* End of storage.  */

#endif  /* End of __STORAGE_SOURCE_H__.  */
